package com.bjsxt.pojo;

import java.util.List;
import java.util.Objects;

public class Dept {
    private Integer deptno;
    private String dname;
    private String ddesc;

    //声明属性存储员工信息
    private List<Emp> empList;

    @Override
    public String toString() {
        return "Dept{" +
                "deptno=" + deptno +
                ", dname='" + dname + '\'' +
                ", ddesc='" + ddesc + '\'' +
                ", empList=" + empList +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Dept dept = (Dept) o;
        return Objects.equals(deptno, dept.deptno) &&
                Objects.equals(dname, dept.dname) &&
                Objects.equals(ddesc, dept.ddesc) &&
                Objects.equals(empList, dept.empList);
    }

    @Override
    public int hashCode() {
        return Objects.hash(deptno, dname, ddesc, empList);
    }

    public Integer getDeptno() {
        return deptno;
    }

    public void setDeptno(Integer deptno) {
        this.deptno = deptno;
    }

    public String getDname() {
        return dname;
    }

    public void setDname(String dname) {
        this.dname = dname;
    }

    public String getDdesc() {
        return ddesc;
    }

    public void setDdesc(String ddesc) {
        this.ddesc = ddesc;
    }

    public List<Emp> getEmpList() {
        return empList;
    }

    public void setEmpList(List<Emp> empList) {
        this.empList = empList;
    }

    public Dept() {
    }

    public Dept(Integer deptno, String dname, String ddesc, List<Emp> empList) {
        this.deptno = deptno;
        this.dname = dname;
        this.ddesc = ddesc;
        this.empList = empList;
    }
}
